using Microsoft.SharePoint;

namespace RoketSolutions.SP2010.Infrostructure.Security
{
    public class SecurityState
    {
        public SecurityState()
        {
            Permissions = new PermissionSet();
        }

        public SecurityState(Principal principal, PermissionSet permissions, ISecurableObject securable)
            : this(principal, permissions, securable, false)
        {
        }

        public SecurityState(Principal principal, PermissionSet permissions, ISecurableObject securable, bool isInherited)
        {
            Principal = principal;
            Permissions = new PermissionSet(permissions);
            IsInherited = isInherited;
            Securable = securable;
        }

        public ISecurableObject Securable
        {
            get;
            set;
        }

        public Principal Principal
        {
            get;
            set;
        }

        public bool IsInherited
        {
            get;
            set;
        }

        public PermissionSet Permissions
        {
            get;
            private set;
        }
    }
}